home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-15 | 873 b | 38 lines | [ftFC/NLft] |
- {
- this program finds the maximum and minimum
- values in the current selection in the current data
- window and writes them to the result window
-
- To run the program, click the button "Add", then choose
- the program "DataTest" from the menu "Misc".
- }
-
- program Findmaximum;
- var
- r,c:integer;max,min:extended;
- maxR,maxC,minR,minC:integer;
-
-
- begin
- max:=-inf;min:=inf;
- for c:=SelectLeft to SelectRight do
- begin
- for r:=SelectTop to SelectBottom do
- if RowSelected(r) then
- begin
- if dataok(r,c) then
- begin
- if data[r,c]>max then
- begin
- maxR:=r;maxC:=c; max:=data[maxR,maxC];
- end;
- if data[r,c]<min then
- begin
- minR:=r;minC:=c; min:=data[minR,minC];
- end
- end
- end
- end;
- Writeln('max is ',max,' at (',maxR,',',maxC,')');
- Writeln('min is ',min,' at (',minR,',',MinC,')');
- end;